package com.meida.student.app.scholartyrant.handler;

import com.meida.common.base.entity.EntityMap;
import com.meida.common.mybatis.interceptor.GetInterceptor;
import com.meida.common.mybatis.query.CriteriaQuery;
import com.meida.module.system.client.entity.SysDictData;
import com.meida.module.user.client.entity.AppEducational;
import com.meida.module.user.client.entity.AppSchool;
import org.springframework.stereotype.Component;

@Component("AppEducationalDetailHandler")
public class AppEducationalDetailHandler implements GetInterceptor {

    @Override
    public void prepare(CriteriaQuery cq, EntityMap entityMap) {
        cq.clear();
        cq.select(AppEducational.class, "educationalId", "schoolId", "educationId", "major", "educationDate");
        cq.select(AppSchool.class,"schoolName");
        cq.select(SysDictData.class,"dicDataTitle");
        cq.createJoin(AppSchool.class).setMainField("schoolId").setJoinField("schoolId");
        cq.createJoin(SysDictData.class).setMainField("educationId").setJoinField("dictDataId");
    }
}
